<%@ include file="/WEB-INF/template/include.jsp"%>

<openmrs:require privilege="View Data Logging Log Entry" otherwise="/login.htm" redirect="/module/datalogging/logEntriesList.list" />

<%@ include file="/WEB-INF/template/header.jsp"%>
<%@ include file="localHeader.jsp"%>

<h2><spring:message code="datalogging.title" /></h2>

<b class="boxHeader">
	<spring:message code="datalogging.event.title" />
</b>
<div class="box">
	<table  width="80%" id="events" cellpadding="2" cellspacing="0">
			<tr>
				<th><spring:message code="datalogging.log.event.id" /></th>
				<td>${logEvent.logEventId}</td>
				<td colspan="2">&nbsp;</td>
			</tr>
			<tr>
				<th><spring:message code="general.name" /></th>
				<td>${logEvent.person.personName.fullName}</td>
				<td colspan="2">&nbsp;</td>
			</tr>
			<tr>
				<th><spring:message code="datalogging.log.event.name" /></th>
				<td>${logEvent.event.name}</td>
				<td colspan="2">&nbsp;</td>
			</tr>
			<tr>
				<th><spring:message code="datalogging.log.event.date.created" /></th>
				<td><openmrs:formatDate date="${logEvent.dateCreated}" type="medium" /></td>
				<td colspan="2">&nbsp;</td>
			</tr>
			<tr>
				<td colspan="4">
					<b class="boxHeader">
						<spring:message code="datalogging.log.entry.title" />
					</b>
					<div class="box">
						<table width="80%" id="entries" cellpadding="2" cellspacing="0">
								<tr>
									<th><spring:message code="general.name" /></th>
									<th><spring:message code="datalogging.log.variable.type" /></th>
									<th><spring:message code="datalogging.log.variable.expression.filter" /></th>
									<th><spring:message code="datalogging.log.variable.expression.value" /></th>
									<th><spring:message code="datalogging.log.entry.value" /></th>
								</tr>
							<c:forEach var="entry" items="${logEvent.entries}" varStatus="varStatus">
								<tr>
									<td>${entry.variable.name}</td>
									<td>${entry.variable.variableType}</td>
									<td>${entry.variable.filterExpression}</td>
									<td>${entry.variable.valueExpression}</td>
									<td>${entry.value}</td>
								</tr>
							</c:forEach>
						</table>
					</div>
				</td>
			</tr>
	</table>
</div>

<%@ include file="/WEB-INF/template/footer.jsp"%>
